package cn.com.bluemoon.daps.sync.core.sync;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * 装载两组数据
 *
 * @author Jarod.Kong
 * @date 2021/1/15 10:24
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Tuple2<T> {
    private T oldT;
    private T newT;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Tuple2<?> tuple2 = (Tuple2<?>) o;
        return Objects.equals(oldT, tuple2.oldT) &&
                Objects.equals(newT, tuple2.newT);
    }

    @Override
    public int hashCode() {
        return Objects.hash(oldT, newT);
    }
}
